<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        console.log(Math.abs(15));//绝对值
        console.log(Math.abs(-15));

        // 参1的参2次方
        console.log(Math.pow(2, 4));
        console.log(Math.round(1.3));//1  四舍五入
        console.log(Math.round(1.5));//2

        console.log(Math.random());//0 - 1 

        // 5-20之间
        console.log(5 + Math.random() * 15);


        var aList = [1, 2, 3];
        console.log(Math.max(...aList));//3
        console.log(Math.min(1, 5, 3, 2, 5));//1

        // 正弦 余弦 正切
        console.log(Math.sin(1));// 值传入的是弧度   π   1弧度 = 180/3.1415...
        console.log(Math.cos(1));//
        console.log(Math.tan(1));//


        console.log(Math.floor(1.3));//向下取整  1
        console.log(Math.floor(-1.3));//向下取整 -2
        console.log(Math.ceil(1.3));//向上取整 2
        console.log(Math.ceil(-1.3));//向上取整 -1
    </script>
</head>

<body>

</body>

</html>